Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODStorageUnit


SetPromiseValue

The SetPromiseValue method writes data to the specified value of the currently focused property, creating the value if it doesn't exist and making the value a promise value.

void SetPromiseValue (in ODValueType valueType,
                      in ODULong offset,
                      in ODByteArray value,
                      in ODPart sourcePart);
valueType
The type of the value where the promise data is to be written.
offset
The offset at which the promise data is to be stored, expressed as an unsigned 32-bit number of bytes from the beginning of the value.
value
A byte array whose buffer contains the promise data to be written.
sourcePart
A reference to the part that made the promise.
DISCUSSION
You call this method to write a promise for a value of the specified type in the currently focused property. You may call this method multiple times to promise values of different types or to write to different offsets in the same value.

This method writes data to the specified value, starting at the specified offset (inclusive), and overwrites any data at and beyond the offset. If the current offset plus the length of data being written is greater than the current size of the value (as returned by the GetSize method), the size of the value is automatically increased to accommodate the new data.

When you no longer need the structure you pass as the value parameter, you should deallocate that structure and its buffer.

EXCEPTIONS
kODErrIllegalNullValueTypeInput
The specified value type is null.
kODErrInvalidValueType
The specified value type is improperly formed or illegal.
kODErrUnfocusedStorageUnit
This storage unit is not focused on a property or a value.
kODErrZeroRefCount
This storage unit has a reference count of 0.
SEE ALSO
The ODByteArray type (page 877).
The ODValueType type (page 904).
The ODStorageUnit::GetPromiseValue method (page 692).
The ODStorageUnit::GetSize method (page 695).
The ODStorageUnit::IsPromiseValue method (page 703).
"The CloneInto Method of Your Part Editor" on page 327 in OpenDoc Programmer's Guide.
"Writing a Promise" on page 330 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help